<?php
    $this->title = "Cadastro de etapas";
    $this->headTitle($this->title);
//    $this->headScript()->appendFile($this->baseUrl() . '/js/secaed.js');
?>
<a class="linkBtn" href="<?php echo $this->url(array('module'=>'default','controller'=>'etapas','action'=>'add'));?>">Adicionar nova etapa</a>
<a class="linkBtn" href="<?php echo $this->url(array('module'=>'default','controller'=>'etapas','action'=>'tarefas'));?>">Listar Tarefas</a>
<a class="linkBtn" href="<?php echo $this->url(array('module'=>'default','controller'=>'index','action'=>'index'));?>">Voltar</a>
<div class="pesquisar ui-widget-header">
    <?php echo $this->form; ?>
</div>
<table  style="width:100%;">
    <tr>
        <th>Ordem</th>
        <th>Aplicação</th>
        <th>Etapa</th>
        <th>Categoria</th>
        <th style="width:90px;">&nbsp;</th>
    </tr>
<?php
    $cont = 0;
    foreach($this->etapas as $etapa) :
        $cont++;
        if($cont % 2 == 0)
            echo '<tr class="even">';
        else
            echo '<tr class="odd">';
?>
        <td class="texto"><?php echo $etapa->ordem ;?></td>
        <td class="texto"><?php echo $etapa->aplicacao;?></td>
        <td class="texto"><?php echo $etapa->etapa ;?></td>
        <td class="texto"><?php echo $etapa->categoria ;?></td>
        <td>
        <a href="<?php echo $this->url(array('controller'=>'tarefas','action'=>'index', 'etapa_id'=>$etapa->id));?>">
        <img alt="Tarefas"  src="<?php echo $this->baseUrl().'/images/tarefas.png'; ?>"></a>
        <a href="<?php echo $this->url(array('controller'=>'etapas','action'=>'edit', 'id'=>$etapa->id));?>">
        <img alt="Editar"  src="<?php echo $this->baseUrl().'/images/edit.png'; ?>"></a>
        <a href="<?php echo $this->url(array('controller'=>'etapas','action'=>'delete', 'id'=>$etapa->id));?>">
        <img alt="Apagar"  src="<?php echo $this->baseUrl().'/images/trash.png'; ?>"></a>
  </td>
<?php
    echo "</tr>";
    endforeach;
?>
</table>


